<template>
  <div>
    <van-search
      v-model="value"
      placeholder="请输入搜索关键词"
      right-icon
    />
    <div
      class="fitmentlist"
      v-for="item in fitmentlist"
      :key="item.fitmentId"
    >
      <div class="fitmentlist-img">
        <img
          :src="item.fitmentImg[0]"
          alt=""
        />
        <img
          :src="item.fitmentImg[1]"
          alt=""
        />
        <img
          :src="item.fitmentImg[2]"
          alt=""
        />
      </div>
      <h2 class="title">{{ item.fitmentText }}</h2>
      <div class="square">
        <span>{{ item.fitmentBrief }}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { getFitmentList } from '@/api/fitment';
export default {
  data() {
    return {
      fitmentlist: [],
      value: '',
    };
  },
  created() {
    this.getFitmentList();
  },
  methods: {
    async getFitmentList() {
      const res = await getFitmentList();
      this.fitmentlist = res.data;
    },
  },
};
</script>

<style lang="scss">
.van-nav-bar__content {
  background-color: #eaeaea;
}
.van-search {
  .van-icon-search {
    left: 0;
    margin-top: -2px;
  }
  .van-search__content {
    height: 30px;
    border: 1px solid #000;
  }

  .van-field__body input {
    color: #000;
    margin-top: -3px;
  }
}
.fitmentlist {
  width: 100%;
  height: 180px;
  margin-top: 20px;
  margin-left: 10px;
  background-color: rgba(255, 255, 255, 100);
  color: rgba(16, 16, 16, 100);

  box-shadow: 2px 2px 6px 0px rgba(202, 199, 199, 40);
  font-family: Arial;
  float: left;
  .fitmentlist-img {
    position: relative;
    text-align: center;
    img {
      float: left;

      top: 10px;
      box-shadow: 0px 2px 6px 2px rgba(0, 0, 0, 0.4);
      border: 2px solid rgba(187, 187, 187, 100);
      position: relative;
    }
    img:nth-child(2) {
      z-index: 999;
      position: relative;
      left: 136px;
      width: 140px;
      height: 100px;
    }
    img:nth-child(3) {
      z-index: 1;
      left: 100px;
      width: 140px;
      height: 100px;
    }

    img:nth-child(1) {
      z-index: 1;
      left: 20px;
      position: absolute;
      width: 140px;
      height: 100px;
    }
  }

  .title {
    width: 300px;
    padding-top: 110px;
    text-align: center;
    color: rgba(16, 16, 16, 100);
    font-size: 16px;
    text-align: left;
    font-family: PingFangSC-regular;
    margin-left: 20px;
  }
  .square {
    margin-left: 20px;
    .spuare span {
      padding-top: 100px;
      width: 200px;
      height: 24px;
      color: rgba(16, 16, 16, 100);
      font-size: 16px;
      text-align: left;
      font-family: PingFangSC-regular;
    }
  }
}
</style>
